#include "menu.h"

#define ITEM 3//Now, we have 3 items on menu

void OptMenu(PageStatus *pStat)
    {
        int SelectedItem = pStat->Item;
        String Option[5], *pOpt = Option;//Strings of Menu items
        InitOption(pOpt);
        ShowOption(pOpt, SelectedItem);
    }

void InitOption(StrGrp *pOpt)
    {
        strcpy(pOpt->Str, "Park New Car");
        pOpt++;
        strcpy(pOpt->Str, "Drive Away");
        pOpt++;
        strcpy(pOpt->Str, "Search");
        pOpt++;
        strcpy(pOpt->Str, "Print Table");
        pOpt++;
        strcpy(pOpt->Str, "Exit");
    }

void ShowOption(StrGrp *pOpt, int SelectedItem)
    {
        for (int i = 0; i < ITEMCOUNT; i++ , pOpt++)
            {
                GoToXY(22, 5+i);
                Polish(i, SelectedItem);
                puts(pOpt->Str);
                EndPolish();
            }
    }

void Polish(int CurrentOptItem, int SelectedItem)
  {
    if (CurrentOptItem == SelectedItem)
      BlackWhite();
  }

void EndPolish()
    {
        WhiteBlack();
    }
